package com.tedu.bill;

import java.util.Scanner;

/**
 * Author：毕龙
 * Date: 2024/3/31 10:15
 */
public class TestArrayAdd {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入5个学生的成绩：");
        double[] scores = new double[5];
        for (int i = 0; i < scores.length; i++) {
            scores[i] = sc.nextDouble();
        }
        //遍历5个学生 进行求和
        double num = 0;
        for (int i = 0; i < scores.length; i++) {
            num += scores[i];
        }
        System.out.println("学生的总成绩："+ num);
    }
}
